package jltx.fragmentpageframework;

import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.View;
import android.widget.Button;

import cn.jltx.support.SupportAppCompatActivity;
import cn.jltx.utils.ViewHelper;
import jltx.fragmentpageframework.simple.SimpleActivity;
import jltx.fragmentpageframework.wetchat.WetChatActivity;
import jltx.fragmentpageframework.wetchat.WetChatActivityV2;
import jltx.fragmentpageframework.zihu.ZhiHuActivity;

/**
 * @author jltxseo
 *         Created by junlintianxia on 2017/05/10.
 */

public class EnterActivity extends SupportAppCompatActivity{

    private Button btnSimple;
    private Button btnCloud;
    private Button btnWeChat;
    private Button btnWeChat2;
    private Button btnToutiao;
    private Button btnZhihu;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_enter);
        Toolbar toolbar = ViewHelper.findViewById(this,R.id.toolbar);
        toolbar.setTitle(R.string.app_name);
        setSupportActionBar(toolbar);
        btnSimple = ViewHelper.findViewById(this,R.id.btn_simple);
        btnCloud = ViewHelper.findViewById(this,R.id.btn_cloud);
        btnWeChat = ViewHelper.findViewById(this,R.id.btn_wechat);
        btnWeChat2 = ViewHelper.findViewById(this,R.id.btn_wechat2);
        btnToutiao = ViewHelper.findViewById(this,R.id.btn_toutiao);
        btnZhihu = ViewHelper.findViewById(this,R.id.btn_zhihu);

        btnSimple.setOnClickListener(onClickListener);
        btnCloud.setOnClickListener(onClickListener);
        btnWeChat.setOnClickListener(onClickListener);
        btnWeChat2.setOnClickListener(onClickListener);
        btnToutiao.setOnClickListener(onClickListener);
        btnZhihu.setOnClickListener(onClickListener);

    }


    private View.OnClickListener onClickListener = new View.OnClickListener(){
        @Override
        public void onClick(View v) {
            switch (v.getId()){
                case R.id.btn_simple:
                    Intent simpleIntent = new Intent(EnterActivity.this, SimpleActivity.class);
                    startActivity(simpleIntent);
                    break;
                case R.id.btn_cloud:
                    break;
                case R.id.btn_wechat:
                    Intent wetchatIntent = new Intent(EnterActivity.this, WetChatActivity.class);
                    startActivity(wetchatIntent);
                    break;
                case R.id.btn_wechat2:
                    Intent wetchatIntent2 = new Intent(EnterActivity.this, WetChatActivityV2.class);
                    startActivity(wetchatIntent2);
                    break;
                case R.id.btn_zhihu:
                    Intent zhihuIntent = new Intent(EnterActivity.this, ZhiHuActivity.class);
                    startActivity(zhihuIntent);
                    break;
                default:
                    break;
            }
        }
    };
}
